Optimal. Leaf size=66 \[ -\frac {\cot ^3(c+d x)}{3 a^2 d}-\frac {2 \cot (c+d x)}{a^2 d}+\frac {\tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac {\cot (c+d x) \csc (c+d x)}{a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2708, 2757, 3767, 8, 3768, 3770} \[ -\frac {\cot ^3(c+d x)}{3 a^2 d}-\frac {2 \cot (c+d x)}{a^2 d}+\frac {\tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac {\cot (c+d x) \csc (c+d x)}{a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2708
Rule 2757
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx &=\frac {\int \csc ^4(c+d x) (a-a \sin (c+d x))^2 \, dx}{a^4}\\ &=\frac {\int \left (a^2 \csc ^2(c+d x)-2 a^2 \csc ^3(c+d x)+a^2 \csc ^4(c+d x)\right ) \, dx}{a^4}\\ &=\frac {\int \csc ^2(c+d x) \, dx}{a^2}+\frac {\int \csc ^4(c+d x) \, dx}{a^2}-\frac {2 \int \csc ^3(c+d x) \, dx}{a^2}\\ &=\frac {\cot (c+d x) \csc (c+d x)}{a^2 d}-\frac {\int \csc (c+d x) \, dx}{a^2}-\frac {\operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{a^2 d}-\frac {\operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (c+d x)\right )}{a^2 d}\\ &=\frac {\tanh ^{-1}(\cos (c+d x))}{a^2 d}-\frac {2 \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc (c+d x)}{a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.91, size = 121, normalized size = 1.83 \[ \frac {\tan \left (\frac {1}{2} (c+d x)\right ) \left (\cot \left (\frac {1}{2} (c+d x)\right )+1\right )^4 \sec ^2\left (\frac {1}{2} (c+d x)\right ) \left (-9 \cos (c+d x)+5 \cos (3 (c+d x))+6 \left (\sin (2 (c+d x))+2 \sin ^3(c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )\right )\right )}{96 a^2 d (\sin (c+d x)+1)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 123, normalized size = 1.86 \[ -\frac {10 \, \cos \left (d x + c\right )^{3} - 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 6 \, \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 12 \, \cos \left (d x + c\right )}{6 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.22, size = 128, normalized size = 1.94 \[ -\frac {\frac {24 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{2}} - \frac {44 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 21 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 6 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1}{a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}} - \frac {a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 21 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.61, size = 132, normalized size = 2.00 \[ \frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{24 d \,a^{2}}-\frac {\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a^{2} d}+\frac {7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d \,a^{2}}-\frac {7}{8 d \,a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}}+\frac {1}{4 a^{2} d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-\frac {1}{24 a^{2} d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.34, size = 153, normalized size = 2.32 \[ \frac {\frac {\frac {21 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {6 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {24 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} + \frac {{\left (\frac {6 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {21 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{3}}{a^{2} \sin \left (d x + c\right )^{3}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.67, size = 119, normalized size = 1.80 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,a^2\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,a^2\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}+\frac {7\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,a^2\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {1}{3}\right )}{8\,a^2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________